package com.tally.server.enums;

/**
 * @Author: sy
 * @Date: 2021/1/28 15:56
 * @Description:
 */
public enum FileUseEnum {
    PHOTO("P", "头像"),
    IMAGE("I", "图片"),
    ;

    private String code;

    private String desc;

    FileUseEnum(String code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FileUseEnum getByCode(String code){
        for(FileUseEnum e:FileUseEnum.values()){
            if(code.equals(e.getCode())){
                return e;
            }
        }
        return null;
    }
}
